// EditMaptileDlg.cpp : implementation file
//

#include "stdafx.h"
#include "editor.h"
#include "EditMaptileDlg.h"
#include "maptile.h"


// CEditMaptileDlg dialog

IMPLEMENT_DYNAMIC(CEditMaptileDlg, CDialog)

CEditMaptileDlg::CEditMaptileDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CEditMaptileDlg::IDD, pParent)
{
	m_ptile = NULL;
}

CEditMaptileDlg::~CEditMaptileDlg()
{
}

void CEditMaptileDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_MAPTILE_NAME, m_tilename);
}


BEGIN_MESSAGE_MAP(CEditMaptileDlg, CDialog)
END_MESSAGE_MAP()

BOOL CEditMaptileDlg::OnInitDialog()
{
	if( m_ptile )
	{
		m_tilename = m_ptile->GetName();
	}
	return CDialog::OnInitDialog();
}

void CEditMaptileDlg::OnOK()
{
	UpdateData( TRUE );
	if( m_ptile )
	{
		m_ptile->SetName( m_tilename );
	}
	return CDialog::OnOK();
}

// CEditMaptileDlg message handlers
